/*
 * Copyright (c) 2015 Minshenglife. All rights reserved. Minshenglife
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.sentry.commons.json;


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * 
 * @author WuBo (wub1@minshenglife.com)
 *
 */
public class Gsons {

    public static final GsonBuilder INSTANCE = build();

    private static GsonBuilder build() {
        GsonBuilder gb = new GsonBuilder();
        gb.disableHtmlEscaping();
        return gb;
    }

    public synchronized static void registTypeAdapter(@SuppressWarnings("rawtypes") Class clazz,Object adapter) {
        INSTANCE.registerTypeAdapter(clazz, adapter);
    }

    public static Gson create() {
        return INSTANCE.create();
    }

}
